package com.study.a04threadDemo4;

public class ThreadDemo {
    public static void main(String[] args) throws InterruptedException {


        //线程有默认名

        //用构造方法给线程命名，继承Thread类
       /* MyThread t1=new MyThread("飞机");
        MyThread t2=new MyThread("火车");

        t1.start();
        t2.start();*/

        //当JVM虚拟机启动后会自动启动多条线程
        //主线程的默认名是main
        /*Thread t=Thread.currentThread();
        System.out.println(t.getName());*/

        //static void sleeo(long time)
        //使当前线程休眠指定的毫秒数

        System.out.println("111111");
        Thread.sleep(5000);
        System.out.println("222222");
    }
}
